VTD: Remove the check for reserved device scope type
authorYang Zhang <yang.z.zhang@Intel.com>
Tue, 16 Apr 2013 08:36:05 +0000 (10:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 16 Apr 2013 08:36:05 +0000 (10:36 +0200)
Though we only have four valid types now, the new type may be added in future.
It's better to remove the check and only deal with the type that we can
recognize.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@Intel.com>
Acked-by: Keir Fraser <keir@xen.org>
Add log message for this case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/vtd/dmar.c
xen/include/acpi/actbl2.h

index 370d5d665ecf93a2c1cb2ee14838b482ca91ea72..c810dbc5319f74675574684d0ed4b49282edebfc 100644 (file)
@@ -283,8 +283,7 @@ static int __init scope_device_count(const void *start, const void *end)
     while ( start < end )
     {
         scope = start;
-        if ( (scope->length < MIN_SCOPE_LEN) ||
-             (scope->entry_type >= ACPI_DMAR_SCOPE_TYPE_RESERVED) )
+        if ( scope->length < MIN_SCOPE_LEN )
         {
             dprintk(XENLOG_WARNING VTDPREFIX, "Invalid device scope.\n");
             return -EINVAL;
@@ -409,6 +408,13 @@ static int __init acpi_parse_dev_scope(
             }
 
             break;
+
+        default:
+            if ( iommu_verbose )
+                printk(XENLOG_WARNING VTDPREFIX "Unknown scope type %#x\n",
+                       acpi_scope->entry_type);
+            start += acpi_scope->length;
+            continue;
         }
         scope->devices[didx++] = PCI_BDF(bus, path->dev, path->fn);
         start += acpi_scope->length;
index a28226ab1169fef8dc47e0d0112c383723e9a919..87bc6b3f569fd99c80bf8225deaa1d09202e8f38 100644 (file)
@@ -303,7 +303,6 @@ enum acpi_dmar_scope_type {
        ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
        ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
        ACPI_DMAR_SCOPE_TYPE_HPET = 4,
-       ACPI_DMAR_SCOPE_TYPE_RESERVED = 5       /* 5 and greater are reserved */
 };
 
 struct acpi_dmar_pci_path {